<template>
  <el-table :data="inboundModel.getList()" style="width: 100%;" height="70vh" @row-click="row => $emit('info', row)">
    <el-table-column :label="plugin.lang('inbound.account_name')" prop="account_name" />
    <el-table-column :label="plugin.lang('inbound.code')" min-width="150">
      <template #default="scope">
        <div class="wrap">{{ scope.row.code }}</div>
      </template>
    </el-table-column>
    <el-table-column :label="plugin.lang('inbound.supplier_id')" min-width="200" prop="supplier_name">
      <template #default="scope">
        <div class="wrap">{{ scope.row.supplier_name }}</div>
      </template>
    </el-table-column>
    <el-table-column :label="plugin.lang('inbound.name')" min-width="150" prop="name">
      <template #default="scope">
        <div class="wrap">{{ scope.row.name }}</div>
      </template>
    </el-table-column>
    <el-table-column :label="plugin.lang('inbound.count')" align="center">
      <template #default="scope">
        <el-link type="primary" href="javascript:;">{{ scope.row.count }}</el-link>
      </template>
    </el-table-column>
    <el-table-column :label="plugin.lang('inbound.time')" width="110">
      <template #default="scope">
        <span>{{ time.date(scope.row.created_at) }}</span><br>
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
import app from '@/app'
import inboundModel from '../../model/inbound'

export default {
  setup() {
    // 加载数据
    inboundModel.get()
    
    return {
      lang: app.lang,
      money: app.money,
      plugin: app.plugin.index,
      time: app.time,
      inboundModel
    }
  }
}
</script>